#!/usr/bin/env node

const {Transform} = require('stream'),
      stdin = process.stdin,
      chalk = require('chalk'),
      stdout = process.stdout;

class transform_class extends Transform{
  constructor(){
    super();
  }
  _transform(chunk,encoding,callback){
    this.push(Buffer.from(chalk.red(chunk.toString('utf8'))));
    callback();
  }
}

let t1 = new transform_class();
stdin.pipe(t1).pipe(stdout);
